
SET(TCHEM_INTERNAL_MAIN_LIBRARY tchem-main)
ADD_LIBRARY(tchem-main STATIC TChem_Main_Util.cpp)
TARGET_LINK_LIBRARIES(${TCHEM_INTERNAL_MAIN_LIBRARY} ${TCHEM_LINK_LIBRARIES} ${TCHEM_INTERNAL_BOOST_TARGET})
TARGET_INCLUDE_DIRECTORIES(${TCHEM_INTERNAL_MAIN_LIBRARY}
  PUBLIC
  $<BUILD_INTERFACE:${CMAKE_CURRENT_SOURCE_DIR}>
)

SET(TCHEM_MAIN_EXE "tchem.x")
ADD_EXECUTABLE(${TCHEM_MAIN_EXE} TChem_Main.cpp)
TARGET_LINK_LIBRARIES(${TCHEM_MAIN_EXE} ${TCHEM_LINK_LIBRARIES} ${TCHEM_INTERNAL_MAIN_LIBRARY})
IF(TCHEM_ENABLE_INSTALL)
  INSTALL(TARGETS ${TCHEM_MAIN_EXE}
          PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
          DESTINATION "${TCHEM_INSTALL_BIN_PATH}")
ENDIF()
SET(TCHEM_JSON_TEST_EXE "tchem-json-test.x")
ADD_EXECUTABLE(${TCHEM_JSON_TEST_EXE} TChem_JSON_Test.cpp)
TARGET_LINK_LIBRARIES(${TCHEM_JSON_TEST_EXE} ${TCHEM_LINK_LIBRARIES} ${TCHEM_INTERNAL_MAIN_LIBRARY})
IF(TCHEM_ENABLE_INSTALL)
  INSTALL(TARGETS ${TCHEM_JSON_TEST_EXE}
          PERMISSIONS OWNER_EXECUTE OWNER_READ OWNER_WRITE
          DESTINATION "${TCHEM_INSTALL_BIN_PATH}")
ENDIF()
SET(TCHEM_MAIN_FILES "input.json;sample.json;input-const-volume-ignition-tla.json")
FOREACH(TCHEM_MAIN_FILE ${TCHEM_MAIN_FILES} )
  FILE(COPY ${TCHEM_MAIN_FILE} DESTINATION ${CMAKE_CURRENT_BINARY_DIR})
  IF(TCHEM_ENABLE_INSTALL)
    INSTALL(FILES ${TCHEM_MAIN_FILE} DESTINATION "${TCHEM_INSTALL_BIN_PATH}")
  ENDIF()
ENDFOREACH()

